/*
 * @lc app=leetcode.cn id=1528 lang=typescript
 *
 * [1528] 重新排列字符串
 */

// @lc code=start
function restoreString(s: string, indices: number[]): string {
    let arr = new Array(indices.length).fill(0);
    for (let i = 0; i < s.length; i++) {
        const index = indices[i];
        const element = s[i];
        arr[index] = element;
    }
    return arr.join("");
}
// @lc code=end
